package com.heima.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.model.article.dtos.ArticleHomeDto;
import com.heima.model.article.pojos.ApArticle;
import com.heima.model.wemedia.dtos.WmStatistics3Dto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface ApArticleMapper extends BaseMapper<ApArticle> {

    /**
     * 加载文章列表
     * @param dto
     * @param type  1 加载更多   2 加载最新
     * @return
     */
    public List<ApArticle> loadArticleList(@Param("dto") ArticleHomeDto dto,@Param("type")  Short type);

    public List<ApArticle> loadArticleListByDays(@Param("dayParam") Date dayParam);

    Integer findCount(@Param("wmStatistics3Dto") WmStatistics3Dto wmStatistics3Dto);

    List<ApArticle> findByPublishTime(@Param("wmStatistics3Dto") WmStatistics3Dto wmStatistics3Dto);
}
